package com.example.unisys.service;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.unisys.entity.SubCourse;
import com.example.unisys.dao.SubCourseMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class SubCourseService extends ServiceImpl<SubCourseMapper,SubCourse> {

 

   public int insert(SubCourse subcourse){
        return baseMapper.insert(subcourse);
    }

   public int insertSelective(SubCourse subcourse){
        return baseMapper.insertSelective(subcourse);
    }

   public int update(SubCourse subcourse){
        return baseMapper.update(subcourse);
    }

   public List<SubCourse> getBySchool(String main_school, String sub_school,int start,int page){
        return baseMapper.getBySchool(main_school,sub_school,start,page);
    }

   public SubCourse getById(String main_school,String sub_school,String course_id){
        return baseMapper.getById(main_school,sub_school,course_id);
    }

    public int getAllCourse(String main_school,String sub_school){
       return baseMapper.getAllCourse(main_school,sub_school);
    }

    public Integer getBySchoolSum(String main_school,String sub_school){
       return baseMapper.getSchoolSum(main_school,sub_school);
    }

    public int getCourseSum(String main_school, String sub_school) {
       return baseMapper.getCourseSum(main_school,sub_school);
    }

    public int delete(String course_id) {
       return baseMapper.delete(course_id);
    }
}
